package com.chaosj.html.markdown.entity;

import cn.hutool.core.text.StrFormatter;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * @className: ScrapeArticle
 * @description:
 * @author: caoyangjie
 * @date: 2021/12/30
 **/
@Data
@Accessors(chain = true)
public class ScrapeArticle implements Serializable {
    /**
     * 标题
     */
    private String title;
    /**
     * 主题标签
     */
    private List<String> tags;
    /**
     * 源地址
     */
    private String originalUrl;
    /**
     * 本地存储路径
     */
    private String localPath;
    /**
     * 抓取时间
     */
    private LocalDate scrapeDate = LocalDate.now();
    /**
     * 发布时间
     */
    private LocalDate publishDate;

    /**
     * 内容
     */
    private String content;

    @Override
    public String toString() {
        return StrFormatter.format( "#{}\nwx {}\n", title, originalUrl);
    }
}
